QGIS – Mapping Election Results, pt 2: Adding and overlaying the data in QGIS
Continuing on from the previous tutorial:-
Return to QGIS. Add the westminster_const_region.shp file if necessary
- Press the Add Delimitated Text file button, and select the .csv export of the cleansed electoral data
- The two options I changed from the default settings are:-
- First record contains field names
- No geometry (attribute only table)
Step 3 – Joining the data
Joining the polygons in westminster_const_region.shp to the data imported from the Results_Cleansed spreadsheet will allow the data to be presented in a spatial and visual format which will be much easier to interpret, allow for spatial analysis and also give the viewer an idea of the geographic spread. Using QGIS’ Join function will hopefully save a lot of copying and pasting!
Right click on westminster_const_region.shp and select Properties to open the Properties dialog
- Select the Joins button from the left panel
- Join Layer – the layer that you want to join to
- Join Field – the field that you want to join to
- Target Field – the field in this layer that contains the matching data
The join will now appear in the layer’s Joins list:-
The attribute table will now show the combined data for both layers:-
This data can now be used to create a thematic map that colours each constituency according to party that won the seat in 2010.
I won’t go through all the steps of creating a thematic map as an earlier tutorial does this.
I’ve used the same colours that the different parties in the UK use:-
The thematic map shows the results across the entire UK. It is easy to identify patterns in the result, for example
- The Liberal Democrats mostly won seats in Scotland, the North East, Wales and South West.
- There is strong Labour support in South West Scotland, North West England, West Midlands, South Wales, London, Liverpool and Manchester.
- The Conservative support covers much of the rest of England, especially South East England, excluding London.